/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package raccoon.suvisa.datos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Laura
 */
@Entity
@Table(name = "PRESTAMO", catalog = "", schema = "IS963601")
@NamedQueries({@NamedQuery(name = "Prestamo.findAll", query = "SELECT p FROM Prestamo p"), @NamedQuery(name = "Prestamo.findByIdPrestamo", query = "SELECT p FROM Prestamo p WHERE p.idPrestamo = :idPrestamo"), @NamedQuery(name = "Prestamo.findByActivo", query = "SELECT p FROM Prestamo p WHERE p.activo = :activo"), @NamedQuery(name = "Prestamo.findByMontoPrestamo", query = "SELECT p FROM Prestamo p WHERE p.montoPrestamo = :montoPrestamo"), @NamedQuery(name = "Prestamo.findByIdPlazo", query = "SELECT p FROM Prestamo p WHERE p.idPlazo = :idPlazo"), @NamedQuery(name = "Prestamo.findByIdInteres", query = "SELECT p FROM Prestamo p WHERE p.idInteres = :idInteres")})
public class Prestamo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PRESTAMO", nullable = false, precision = 22)
    private BigDecimal idPrestamo;
    @Basic(optional = false)
    @Column(name = "ACTIVO", nullable = false)
    private char activo;
    @Basic(optional = false)
    @Column(name = "MONTO_PRESTAMO", nullable = false)
    private double montoPrestamo;
    @Basic(optional = false)
    @Column(name = "ID_PLAZO", nullable = false)
    private BigInteger idPlazo;
    @Basic(optional = false)
    @Column(name = "ID_INTERES", nullable = false)
    private BigInteger idInteres;

    public Prestamo() {
    }

    public Prestamo(BigDecimal idPrestamo) {
        this.idPrestamo = idPrestamo;
    }

    public Prestamo(BigDecimal idPrestamo, char activo, double montoPrestamo, BigInteger idPlazo, BigInteger idInteres) {
        this.idPrestamo = idPrestamo;
        this.activo = activo;
        this.montoPrestamo = montoPrestamo;
        this.idPlazo = idPlazo;
        this.idInteres = idInteres;
    }

    public BigDecimal getIdPrestamo() {
        return idPrestamo;
    }

    public void setIdPrestamo(BigDecimal idPrestamo) {
        this.idPrestamo = idPrestamo;
    }

    public char getActivo() {
        return activo;
    }

    public void setActivo(char activo) {
        this.activo = activo;
    }

    public double getMontoPrestamo() {
        return montoPrestamo;
    }

    public void setMontoPrestamo(double montoPrestamo) {
        this.montoPrestamo = montoPrestamo;
    }

    public BigInteger getIdPlazo() {
        return idPlazo;
    }

    public void setIdPlazo(BigInteger idPlazo) {
        this.idPlazo = idPlazo;
    }

    public BigInteger getIdInteres() {
        return idInteres;
    }

    public void setIdInteres(BigInteger idInteres) {
        this.idInteres = idInteres;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPrestamo != null ? idPrestamo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prestamo)) {
            return false;
        }
        Prestamo other = (Prestamo) object;
        if ((this.idPrestamo == null && other.idPrestamo != null) || (this.idPrestamo != null && !this.idPrestamo.equals(other.idPrestamo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "raccoon.suvisa.datos.entities.Prestamo[idPrestamo=" + idPrestamo + "]";
    }

}
